package com.hjy.cabinet.ws.controller;

import com.hjy.cabinet.ws.domain.test.StudentTest;
import com.hjy.cabinet.ws.domain.ws.WsAnnotation;

import java.util.List;
import java.util.Map;

//各种类型测试
public class WsTestController {


    //收到消息
    //类型测试
    @WsAnnotation(value = "testType")
    public void testType(StudentTest studentTest, List<StudentTest> studentTests, List<String> strings, Map<String, StudentTest> studentTestMap) {
        System.out.println("类型测试-一般类型");
        System.out.println(studentTest);
        System.out.println("类型测试-集合一般类型");
        System.out.println(studentTests);
        System.out.println("类型测试-集合string类型");
        System.out.println(strings);
        System.out.println("类型测试-集合map类型");
        System.out.println(studentTestMap);
    }


    //正常请求测试
    @WsAnnotation(value = "test")
    public String test(String param) {
        if("1".equals(param)){
            return "请求成功";
        }else if("2".equals(param)) {
            RuntimeException err = new RuntimeException("请求错误");
            throw err;
        }else if("3".equals(param)){
            System.out.println(1 / 0);
        }
        return param;
    }

}

